package net.steam.easyjoboa.biz.impl;

import java.util.List;

import net.steam.easyjoboa.biz.VoteBiz;
import net.steam.easyjoboa.dao.VoteDao;
import net.steam.easyjoboa.entity.Vote;

public class VoteBizImpl implements VoteBiz {

private VoteDao voteDao;
	
	//�õ�����
	public List<Vote> getVotesList() {
		String hql = "from Vote";
		return voteDao.find(hql);
	}
	//���Id�õ�Vote
	public Vote getVote(int id) {
		return voteDao.findById(id);
	}
	//���Vote
	public void addVote(Vote vote) {
		try {
			voteDao.addEntity(vote);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//�޸�Vote
	public void updateVote(Vote vote) {
		voteDao.updateEntity(vote);
	}
	//ɾ��Vote
	public void deleteVote(Vote vote) {
		try {
			voteDao.deleteEntity(vote.getVoteId());
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	
	
	//���е�get set����
	public void setVoteDao(VoteDao voteDao) {
		this.voteDao = voteDao;
	}
	
	
	
}
